<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/** 
* Menu Class 
* 
* Class to determine menu, such as when member login disable login and 
* register button
*
* @category	Libraries
* @subpackage Custom Libraries
* @author Ari Oaks
*/

class Mymenu{

	var $CI;
	var $menus;
	//var $menus['menu_main'] = array();
	
	function Mymenu()
	{
		$this->CI =& get_instance();
	}
	
	function menu_header()
	{
		$segment = $this->CI->uri->segment(1, 0);
		$segment = str_replace("_html","",$segment);
		
		$menus = $this->CI->Menu_model->get_menus(1)->result_array();
		$menu = '<ul>';
		foreach($menus as $item):

				$slug = $item['slug'];
			
				if($slug==''):
					$active = (!$segment) ? 'current' : '';
					$menu .= 	'<li class="'.$active.'"><a href="'.site_url($slug) .'"><span>'.strtoupper($item['title']).'</span></a></li>';
				else:
					$active = ($segment && $segment==$item['slug']) ? 'current' : '';
					$menu .= 	'<li class="'.$active.'"><a href="'.site_url($slug) .'"><span>'.strtoupper($item['title']).'</span></a></li>';
				endif;
		endforeach;
		$menu .= 	'</ul>';
		
		
		return $menu;
	}
	
	
	
}

/* End of file Mymenu.php */ 
/* Location: ./system/application/libraries/Mymenu.php */ 